<?php
define('BASEDIR', './');
require BASEDIR . 'bin.php';
// echo $_SERVER['SERVER_ADDR']; exit;

if ($_SERVER['SERVER_ADDR'] != '127.0.0.1') {
	$mysqli = new mysqli('mysql5-10.perso', 'mnstrlbase', 'a7q4w1', 'mnstrlbase');
} else {
	$mysqli = new mysqli('localhost', 'root', '', 'mnstrlbase');
}

$result = $mysqli->query('SELECT * from scores WHERE triche=0 ORDER by score DESC');


?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
	<title><?php echo $game_title; ?></title>
	<meta http-equiv="Content-Script-Type" content="text/javascript" />
	<meta http-equiv="Content-Style-Type" content="text/css" />
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"  />
	<link rel="stylesheet" href="default.css?t=<?php echo TrafficSessionManager::getGameToken(); ?>" type="text/css" media="screen" />
	<link rel="stylesheet" href="fancybox/jquery.fancybox.css" type="text/css" media="screen" />
	<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
	<script type="text/javascript" src="jquery.ajaxq-0.0.1.js"></script>
	<script type="text/javascript" src="date.js"></script>
	<script type="text/javascript" src="fancybox/jquery.fancybox.pack.js"></script>
</head>
<body>
	<div id="game_title">
		&nbsp;&nbsp;<?php echo $game_title; ?>
	</div>
	<div align="center">
		<p></p>
		<b>SCORES</b>
		<p></p>
		<table><?php
			while($row = $result->fetch_object()) {
				echo '<tr>';
				echo '<td>' . htmlentities($row->pseudo, ENT_QUOTES, 'ISO-8859-1') . '</td>';
				echo '<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>';
				echo '<td>' . htmlentities($row->score, ENT_QUOTES, 'ISO-8859-1') . '</td>';
				echo '</tr>';
			}
		?></table>
		<br /><br /><a class="option_message" href="game.php">Recommencer</a> - <a class="option_message" href="https://www.facebook.com/sharer/sharer.php?u=trafic.mnstrl.org" target="_blank">Partager sur Facebook</a>
	</div>
</body>